<?php
if(!class_exists('XMapping', false)){
	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'XMapping.php');
}
class XOneToMany extends XMapping{
	function result($value = null){
		$query = q($this->target())->eq($this->foreignKey(), $value);		
		foreach($this->orders() as $field => $order){
			$query = $query->$order($field);
		}
		return $query->findAll();
	}
}
?>